# -*- coding: utf-8 -*-
"""
 @Time    : 2021/1/26 上午9:29
 @Author  : tgy
 
"""


def numEquivDominoPairs(dominoes: [[int]]) -> int:
    count = 0
    count_list = [0] * 100
    for k1, k2 in dominoes:
        ...
        val = k1 * 10 + k2 if k1 >= k2 else k2 * 10 + k1
        count += count_list[val]
        count_list[val] += 1

    return count


if __name__ == '__main__':
    ...
    # 如果每一位都小于 10，则可以使用把两位转换成十进制数
    res = numEquivDominoPairs([[1, 2], [2, 1], [2, 1], [1, 2], [3, 4], [5, 6]])
    print(res)
